package cn.zqh.commodity.service;

import cn.zqh.bean.api.CommonResult;
import cn.zqh.bean.bo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.bind.annotation.RequestBody;

import java.io.IOException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zqh
 * @since 2022-12-24
 */
public interface CommodityService extends IService<Commodity> {

    /**
      * @Author: zqh
      * @Date:
      * @Description: 添加新商品
    */
    CommonResult addANewCommodity(@RequestBody Pfoods pfoods)throws IOException;

    /**
      * @Author: zqh
      * @Date:
      * @Description: 查询所有商品
    */
    CommonResult getAll();


    /**
      * @Author: zqh
      * @Date:
      * @Description: 根据id删除商品
    */
    CommonResult delACommodityById(String id)throws IOException;


    /**
      * @Author: zqh
      * @Date:
      * @Description: 店主修改商品信息
    */
    CommonResult StoreOwnerModifiesProductInformation(UserChangeCommodity userChangeCommodity)throws IOException;
    
    
    /**
      * @Author: zqh
      * @Date: 
      * @Description: 管理员修改商品信息
    */
    CommonResult ModifyTheProductInformationBasedOnTheAdministrator(AdminChangeCommodity adminChangeCommodity)throws IOException;
    
    
    /**
      * @Author: zqh
      * @Date: 
      * @Description: 创建commodity的es数据库
    */
    CommonResult CreateEsDataBaseOfCommodity() throws IOException;


    /**
      * @Author: zqh
      * @Date:
      * @Description: 删除commodity的es数据库
    */
    CommonResult DelEsDataBaseOfCommodity()throws IOException;
    
    /**
      * @Author: zqh
      * @Date: 
      * @Description: 判断commodity的es数据库是否存在
    */
    CommonResult DetermineWhetherTheEsCommunityExists()throws IOException;

    /**
      * @Author: zqh
      * @Date:
      * @Description: 把数据库中所有商品数据上传到es数据库
    */
    CommonResult UploadAllDataInTheDatabaseToTheEsDatabase()throws IOException;


    /**
      * @Author: zqh
      * @Date:
      * @Description: 搜索时给与提示
    */
    CommonResult searchEngines(String t)throws IOException;

    /**
      * @Author: zqh
      * @Date:
      * @Description: 多条件复合查询
    */
    CommonResult CompoundQuery(SearchBean searchBean)throws IOException;

    /**
      * @Author: zqh
      * @Date:
      * @Description: 根据id查询商品
    */
    CommonResult getCommodityById(String id)throws IOException;

    
    /**
      * @Author: zqh
      * @Date: 
      * @Description: 获取商品信息
    */
    CommonResult gCommodity(String id);


    /**
      * @Author: zqh
      * @Date: 
      * @Description: 获取所有商品得数量
    */
    CommonResult getAllCommodityNumbers(Integer del);

    /**
      * @Author: zqh
      * @Date:
      * @Description: 获取被删除的所有商品
    */
    CommonResult getDelCommoditys(Integer page,Integer size);


    /**
      * @Author: zqh
      * @Date:
      * @Description: 把删除的商品取消删除
    */
    CommonResult cancelDeletionOfDeletedGoods(String id)throws IOException;


    /**
      * @Author: zqh
      * @Date:
      * @Description: 修改商品库存
    */
    CommonResult changeItemInventory(String commodityId, Integer number)throws IOException;
}
